<template>
  <div>
    <v-scale-screen
      width="6240"
      height="1404"
      :boxStyle="{
        backgroundColor: '#05163d',
      }"
    >
      <div class="back">
        <a
          class="ant-btn ant-btn-primary y-button y-button--primary"
          style="top: 1px; cursor: not-allowed; border-color: #666; color: #666"
          href="javascript:;"
          >公租房</a
        >
        <router-link class="ant-btn ant-btn-primary y-button y-button--primary" to="/bzfDataScreen" style="top: 1px"
          >保租房</router-link
        >
      </div>
      <div class="wrapper">
        <div class="column">
          <div style="display: flex">
            <synopsis @fullScreen="handleFullScreen('synopsis')" style="margin-right: 5px"></synopsis>
            <project @fullScreen="handleFullScreen('project')" style="margin-left: 5px"></project>
          </div>
          <div style="display: flex">
            <house-type
              :areaID="areaid"
              @fullScreen="handleFullScreen('houseType')"
              style="margin-right: 5px"
            ></house-type>
            <rent :areaID="areaid" @fullScreen="handleFullScreen('rent')" style="margin-left: 5px"></rent>
          </div>
          <method-analysis :areaID="areaid" @fullScreen="handleFullScreen('methodAnalysis')"></method-analysis>
        </div>
        <div class="column">
          <big-map @updateAreaID="updateAreaID"></big-map>
        </div>
        <div class="column">
          <personnel-analysis :areaID="areaid" @fullScreen="handleFullScreen('personnelAnalysis')"></personnel-analysis>
          <div style="display: flex">
            <occupancy-rate
              :areaID="areaid"
              @fullScreen="handleFullScreen('occupancyRate')"
              style="margin-right: 5px"
            ></occupancy-rate>
            <distribution-status
              :areaID="areaid"
              @fullScreen="handleFullScreen('distributionStatus')"
              style="margin-left: 5px"
            ></distribution-status>
          </div>
          <situation-analysis :areaID="areaid" @fullScreen="handleFullScreen('situationAnalysis')"></situation-analysis>
        </div>
      </div>
    </v-scale-screen>
    <a-modal
      class="full-modal"
      :visible="visibleFullScreen"
      @cancel="handleCancel"
      width="60%"
      centered
      destroyOnClose
      :footer="null"
    >
      <component :is="fullComponent" :areaID="areaid" class="full-screen" :isFullscren="isFullscren"></component>
    </a-modal>
  </div>
</template>

<script>
import synopsis from './components/synopsis'
import situationAnalysis from './components/situationAnalysis'
import houseType from './components/houseType'
import distributionStatus from './components/distributionStatus'
import bigMap from './components/map'
import personnelAnalysis from './components/personnelAnalysis'
import occupancyRate from './components/occupancyRate'
import methodAnalysis from './components/methodAnalysis'
import rent from './components/rent'
import project from './components/project'

export default {
  components: {
    synopsis,
    situationAnalysis,
    houseType,
    distributionStatus,
    bigMap,
    personnelAnalysis,
    occupancyRate,
    methodAnalysis,
    rent,
    project,
  },
  data() {
    return {
      visibleFullScreen: false,
      isFullscren: false,
      fullComponent: '',
      areaid: 0,
    }
  },
  methods: {
    handleFullScreen(name) {
      this.visibleFullScreen = true
      this.isFullscren = true
      this.fullComponent = name
    },
    updateAreaID(id) {
      this.areaid = id
    },
    handleCancel() {
      this.visibleFullScreen = false
      this.isFullscren = false
    },
  },
}
</script>
<style lang="less" scoped>
.back {
  position: absolute;
  z-index: 999;
  top: 10px;
  left: 30px;
  /deep/ .ant-btn-primary {
    background-color: transparent;
  }
}
.full-modal {
  /deep/ .ant-modal-body {
    padding: 46px;
    background-color: #05163d;
  }
  /deep/ .ant-modal-close-icon {
    color: #fff;
  }
  /deep/ .full-screen {
    color: #fff;
    .anticon-fullscreen {
      display: none;
    }
  }
}
.wrapper {
  width: 6240px;
  height: 1404px;
  background-image: url(../../../assets/images/charts-bg2.png);
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  color: #fff;
  box-sizing: border-box;
  padding: 130px 30px 30px;
  font-size: calc(100vw * 14 / 8320);
  .column {
    flex: 1;
    min-width: 100px;
    position: relative;
    &:nth-child(2) {
      flex: 1;
      margin: 30px;
    }
  }
}
/deep/ .border-line {
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  position: relative;
  border: 1px solid red;
  border-image: url(../../../assets/images/charts-border.png) 1 1;
  border-width: 1px;
  padding: 20px;
  margin-bottom: 20px;
}
</style>
